//
//  MoreViewController.m
//  享动
//
//  Created by lanou on 16/4/7.
//  Copyright © 2016年 HHUI. All rights reserved.
//

#import "MoreViewController.h"
#import "LoginViewController.h"
#import "MoreView.h"
#import "UserDataViewController.h"

@interface MoreViewController ()

@end

@implementation MoreViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    MoreView *moreView = [[MoreView alloc] init];
    [moreView.editData addTarget:self action:@selector(editDataAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:moreView];
    
    //self.toLoginButton = [UIButton buttonWithType:UIButtonTypeSystem];
    // Do any additional setup after loading the view.
}

- (IBAction)toLogin:(id)sender {
    LoginViewController *loginVc = [[LoginViewController alloc] initWithNibName:@"login" bundle:[NSBundle mainBundle]];
    self.tabBarController.tabBar.hidden = YES;

    [self.navigationController pushViewController:loginVc animated:YES];
}

- (void)viewDidAppear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden = NO;
    self.navigationController.navigationBar.hidden = NO;
}

#pragma mark --- 点击编辑个人资料按钮触发的方法---
- (void)editDataAction:(UIButton *)sender
{
    // 创建CATransition对象
    CATransition *animation = [CATransition animation];
    
    //设置运动时间
    animation.duration = 1;
    
    //设置运动type
    animation.type = kCATransitionFromRight;
    
    //设置运动速度
    animation.timingFunction = UIViewAnimationOptionCurveEaseInOut;
    
    [self.navigationController.view.layer addAnimation:animation forKey:nil];
    
    UserDataViewController *userDataVc = [[UserDataViewController alloc] initWithNibName:@"UserData" bundle:[NSBundle mainBundle]];
    
    [self.navigationController pushViewController:userDataVc animated:YES];
}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
